package com.kili.dbliy;

import javax.persistence.*;
import java.util.Objects;

/**
 * @date 19-11-2
 * @auther jackliang
 * @description TODO
 */
@Entity
@Table(name = "k_permission", schema = "permission", catalog = "")
public class KPermissionEntity {
    private int id;
    private String permissionCode;
    private String description;
    private Integer status;
    private Long createTime;
    private Long updateTime;
    private Integer sysCode;
    private Integer hiddened;
    private Integer alwayShow;
    private String redirect;
    private String name;
    private String meta;
    private String path;
    private String component;
    private Long parentId;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "permission_code", nullable = false, length = 20)
    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 255)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = true)
    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "sys_code", nullable = true)
    public Integer getSysCode() {
        return sysCode;
    }

    public void setSysCode(Integer sysCode) {
        this.sysCode = sysCode;
    }

    @Basic
    @Column(name = "hiddened", nullable = true)
    public Integer getHiddened() {
        return hiddened;
    }

    public void setHiddened(Integer hiddened) {
        this.hiddened = hiddened;
    }

    @Basic
    @Column(name = "alway_show", nullable = true)
    public Integer getAlwayShow() {
        return alwayShow;
    }

    public void setAlwayShow(Integer alwayShow) {
        this.alwayShow = alwayShow;
    }

    @Basic
    @Column(name = "redirect", nullable = true, length = 100)
    public String getRedirect() {
        return redirect;
    }

    public void setRedirect(String redirect) {
        this.redirect = redirect;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "meta", nullable = true, length = 200)
    public String getMeta() {
        return meta;
    }

    public void setMeta(String meta) {
        this.meta = meta;
    }

    @Basic
    @Column(name = "path", nullable = true, length = 50)
    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Basic
    @Column(name = "component", nullable = true, length = 50)
    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    @Basic
    @Column(name = "parent_id", nullable = true)
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        KPermissionEntity that = (KPermissionEntity) o;
        return id == that.id &&
                Objects.equals(permissionCode, that.permissionCode) &&
                Objects.equals(description, that.description) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(sysCode, that.sysCode) &&
                Objects.equals(hiddened, that.hiddened) &&
                Objects.equals(alwayShow, that.alwayShow) &&
                Objects.equals(redirect, that.redirect) &&
                Objects.equals(name, that.name) &&
                Objects.equals(meta, that.meta) &&
                Objects.equals(path, that.path) &&
                Objects.equals(component, that.component) &&
                Objects.equals(parentId, that.parentId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, permissionCode, description, status, createTime, updateTime, sysCode, hiddened, alwayShow, redirect, name, meta, path, component, parentId);
    }
}
